package com.imooc.girl.util;

import com.imooc.girl.domain.GetAddGrade;
import com.imooc.girl.domain.GetGradeResult;
import com.imooc.girl.domain.GetStuGrade;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MapStuGrade {
    public static List<GetGradeResult> getStuGrade(List<GetStuGrade> list,Map<Object,Set<GetAddGrade>> map){
        List<GetGradeResult> result= new ArrayList<>();
        for(int i=0;i<list.size();i++){
            GetGradeResult cur = new GetGradeResult();
            cur.set_class(list.get(i).getStuInfo().getStuClass());
            cur.setAddGrade(list.get(i).getAddGrade());
            cur.setAllGrade(list.get(i).getAllGrade());
            cur.setClassRank(list.get(i).getClassRank());
            cur.setCompreRank(list.get(i).getCompreRank());
            cur.setCredit(list.get(i).getCredit());
            cur.setFailNum(list.get(i).getFailNum());
            cur.setGrade(list.get(i).getGrade());
            cur.setMajor(list.get(i).getStuInfo().getMajor());
            cur.setMoral(list.get(i).getMoral());
            cur.setName(list.get(i).getStuInfo().getStuName());
            cur.setNumber(list.get(i).getStuInfo().getStuid());
            cur.setYearTerm(list.get(i).getYearTerm());
            cur.setMajorRank(list.get(i).getMajorRank());
            cur.setAddGroup(map.get(list.get(i).getId()));
            result.add(cur);
        }
        return result;
    }
}
